Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-231: Use direct database access for entity: place #110

Merged
merged 2 commits into from Jul 4, 2017

Conversation

ferbncode
Copy link
Member

Use direct database access for entity place. I have added functions entity_relation_helper and get_place_by_id for fetching information regarding place.

@gentlecat
Copy link
Contributor

Have you considered using mbdata package for this purpose?

@ferbncode ferbncode force-pushed the cb-231-entity/plate branch 11 times, most recently from 6f870b7 to d6dca2d Compare June 26, 2017 07:09
@ferbncode ferbncode changed the title [WIP]: CB-231: Use direct database access for entity: place CB-231: Use direct database access for entity: place Jun 26, 2017
@@ -0,0 +1,16 @@
import critiquebrainz.frontend.external.musicbrainz_db.exceptions as mb_exceptions

RELATABLE_TYPES = ['area', 'artist', 'label', 'place', 'event', 'recording', 'release', 'release-group', 'series', 'url', 'work', 'instrument']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This row is a bit too long. Can you split it like this?

RELATABLE_TYPES = [
    'area',
    ...
    'instrument',
]

THREAD_POOL_PROCESSES = 10


def get_place_by_id(id):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to be more specific here and use mbid instead of id. I usually try to avoid using id since it's a built in function.

@gentlecat
Copy link
Contributor

Haven't been able to test this due to problems with the MusicBrainz database image setup. https://chatlogs.metabrainz.org/brainzbot/metabrainz/2017-06-26/?msg=3940782&page=2

@ferbncode ferbncode force-pushed the cb-231-entity/plate branch 2 times, most recently from 9c5c988 to e49ce44 Compare July 2, 2017 20:19
Copy link
Contributor

@gentlecat gentlecat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be working. Awesome!

@gentlecat gentlecat merged commit dc9f9ab into metabrainz:master Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants